package com.demo.webapp.kcfinder.action;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.demo.core.dao.UserDao;
import com.demo.core.model.Config;

public class TestAction extends ActionSupport {

	@Autowired
	private UserDao userDao;
	
	Config config1, config2;
	List<Config> configList;
	public String index() {
		config1 = new Config();
		config1.setEnabled(true);
		config1.setI18n("i18n1");
		config1.setId(245L);
		config1.setName("name1");
		config1.setNotes("notes1");
		config1.setTitle("title1");
		config1.setType("type1");
		config1.setValue("value1");
		
		configList = new ArrayList<Config>();
		
		config2 = new Config();
		config2.setEnabled(false);
		config2.setI18n("i18n2");
		config2.setId(249L);
		config2.setName("name2");
		config2.setNotes("notes2");
		config2.setTitle("title2");
		config2.setType("type2");
		config2.setValue("value2");
		
		configList.add(config2);
		
		this.push("result", configList);
		this.push("key", "Value");
		userDao.hashCode();
		return SUCCESS;
	}
	
	
	public String list() {
		index();
		this.push("result", configList);
		return SUCCESS;
	}
}
